package org.hyh.javaConfig;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @auther :hyh
 * @desc :
 * @date :2019/12/12
 */
public class TestJAVAConfig {

	public static void main(String[] args) {
		ApplicationContext ac = new AnnotationConfigApplicationContext(JavaConfig.class);
//		((AnnotationConfigApplicationContext) ac).scan();   // 也可以通过，此方法来启动
//		((AnnotationConfigApplicationContext) ac).register(); //也可以通过此方法来 启动
		String[] bdNames = ac.getBeanDefinitionNames();
		for (String bdName : bdNames) {
			System.out.println(bdName);
		}
		AUser bean= ac.getBean(AUser.class);
		System.out.println(bean);
	}
}
